#include<iostream>
#include<string>
#include "Exp.h"
using namespace std;

int main()
{
    Exp* exp = new IntExp(1);
    for(int i = 2; i < 5; i++){
        exp = new AddExp(exp, new IntExp(i));
    }

    Visitor CalSum;
    exp->accept(CalSum);
    cout << "Result is " << CalSum.result << endl;
    return 0;
}
